 
 /**
  *
  *BI图层叠加
  */
 BILayerWidget=OpenLayers.Class(BaseWidget,{
 		
 	initialize : function() {
 		//this.requireWidget("js/lib/Highcharts/highcharts.js");
	},
	Feature: null,
	//返回组装好的地图切换控件dom对象
	getElement : function(){
		if(!this.element){
			if(this.config){
				this.element = this.createElement(this.map);	
			}
		}
		return this.element;
	},
	createElement : function(){
		var $this=this;
		
		 //$this.Feature=new OpenLayers.Feature.Vector("BI");filter:alpha(opacity=100);
		// $this.map.addLayers([$this.Feature]);
		for(var i=0;i<5;i++){
			var rand1=Math.random()*100;
			var rand2=Math.random()*100;
			var lonlat=new OpenLayers.LonLat(123.222595-rand1,35.70737+rand2).transform(this.map.displayProjection,this.map.getProjectionObject());
            var bi_id='BI_layer_'+i;
            var popup = new OpenLayers.Popup(
            	  "chicken",
                   lonlat,
                   new OpenLayers.Size(400,200),
                   "<div id='"+bi_id+"' style='width:100%;height:100%;'></div>",
                   false);
			this.map.addPopup(popup);
			popup.div.style.backgroundColor='transparent';
			//$this.addChart(bi_id);
			//popup.div.style.backgroundImage="url('http://map.baidu.com/image/markers_new.png')";
			
			var chart = new Highcharts.Chart({
	            chart: {
	                renderTo: bi_id,
	                visible : false,
	                type: 'column',//bar,column,pie,line
	                borderColor :'red',
	                backgroundColor : null,
	                //plotBackgroundImage: 'http://map.baidu.com/image/markers_new.png',
	                //className :'chart_backgournd',
	                plotBorderWidth: null,
	                plotShadow: false
	            },
	            title: {
	                text: ''
	            },
	            tooltip: {
	        	    //pointFormat: '{series.name}: <b>{point.percentage}%</b>',
	            	//percentageDecimals: 1
	            },
	            plotOptions: {
	                pie: {
	                    allowPointSelect: true,
	                    cursor: 'pointer',
	                    backgroundColor : 'red',
	                    dataLabels: {
	                        enabled: true,
	                        color: '#000000',
	                        //connectorColor: 'transparent',
	                        formatter: function() {
	                           // return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
	                        }
	                    }
	                },
	                area :{
	                	//fillOpacity :.8,
	                	fillColor :'white'
	                }
	            },
	            series: [{
	                //type: 'pie',
	                //name: 'Browser share',
	                data: [
	                    ['Firefox',   45.0],
	                    ['IE',       26.8],
	                    {
	                        name: 'Chrome',
	                        y: 12.8,
	                        sliced: true,
	                        selected: true
	                    },
	                    ['Safari',    8.5],
	                    ['Opera',     6.2],
	                    ['Others',   0.7]
	                ]
	            }]
	        });
	        
	        
		}
			//$("#BI_layer").css({'opacity':'0.7'});
			var content=$("<div style='display:none;'>BI</div>");
			return content;
	},
	addChart :function(containerId){
		//饼图
		/*
		var chart = new Highcharts.Chart({
	            chart: {
	                renderTo: containerId,
	                visible : false,
	                backgroundColor:null,//transparent
	                plotBorderWidth: null,
	                plotShadow: false
	            },
	            title: {
	                text: ''
	            },
	            tooltip: {
	            },
	            plotOptions: {
	                pie: {
	                    allowPointSelect: true,
	                    cursor: 'pointer',
	                    backgroundColor : 'red',ie
	                    dataLabels: {
	                        enabled: true,
	                        color: '#000000',
	                        formatter: function() {
	                           // return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
	                        }
	                    }
	                },
	                area :{
	                }
	            },
	            series: [{
	                type: 'pie',
	                name: 'Browser share',
	                data: [
	                    ['Firefox',   45.0],
	                    ['IE',       26.8],
	                    {
	                        name: 'Chrome',
	                        y: 12.8,
	                        sliced: true,
	                        selected: true
	                    },
	                    ['Safari',    8.5],
	                    ['Opera',     6.2],
	                    ['Others',   0.7]
	                ]
	            }]
	        });
	        */
	        
	        //
	       var chart = new Highcharts.Chart({
            chart: {
                renderTo: containerId,
                type: 'pie',//bar,column,pie,line
                backgroundColor : 'transparent',
                //backgroundColor : 'green',//transparent
                //plotBackgroundColor : 'gray',
                //plotBackgroundColor :'gray',
                //plotBackgroundImage: 'http://map.baidu.com/image/markers_new.png',
                marginRight: 130,
                marginBottom: 25
            },
            title: {
                //text: 'Monthly Average Temperature',
                //x: -20 //center
            },
            subtitle: {
                text: '',
                x: -20
            },
            xAxis: {
                categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
                    'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
            },
            yAxis: {
                title: {
                    text: 'Temperature (°C)'
                },
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#808080'
                }]
            },
            tooltip: {
                formatter: function() {
                        return '<b>'+ this.series.name +'</b><br/>'+
                        this.x +': '+ this.y +'°C';
                }
            },
            plotOptions: {
	                pie: {
	                    allowPointSelect: true,
	                    cursor: 'pointer',
	                    backgroundColor : 'red',
	                    dataLabels: {
	                        enabled: true,
	                        color: '#000000',
	                        formatter: function() {
	                           // return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
	                        }
	                    }
	                },
	                area :{
	                }
	         },
            legend: {
            	enabled: false,
                layout: 'vertical',
                //backgroundColor: '#FFFFFF',
                align: 'right',
                verticalAlign: 'top',
                x: -10,
                y: 100,
                borderWidth: 0
            },
            series: [{
                name: 'Tokyo',
                data: [7.0, 6.9, 9.5, 14.5, -18.2, 21.5, 25.2]
            }, {
                name: 'New York',
                data: [-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8]
            }]
        });
	        
	},
	requireWidget : function(label){
		var jsNode = document.createElement('script');
        jsNode.setAttribute('src', label);
        jsNode.setAttribute('type', 'text/javascript');
		document.getElementsByTagName('head')[0].appendChild(jsNode); 
	},
	CLASS_NAME:"openGis.BILayerWidget"
 });